package com.JQ;

import java.util.HashMap;
import java.util.Set;

public class HasMapDemo01 {
    public static void main(String[] args) {
        HashMap<String,Integer> hm= new HashMap<>();
        hm.put("柳岩",2100);
        hm.put("张亮",1700);
        hm.put("诸葛亮",1800);
        hm.put("灭绝师太",2600);
        hm.put("东方不败",3800);
        //获取到柳岩的工资
        int salry = hm.get("柳岩");
        System.out.println(salry);
        //修改柳岩的工资为当前工资加上300
        hm.put("柳岩",salry+300);
        //使用增强for+keySet迭代出每个员工的工资
        Set<String> keys = hm.keySet();
        for (String key : keys) {
            Integer value = hm.get(key);
            System.out.println(key+"---"+value);
        }
    }
}
